How does a color sensor work?